import{d as _,M as d,a as g,o,b as c,w as m,F as k,D as p,t as v,f as b,m as y,H as w,c as T,n as B,_ as x}from"./index-c80Lh_is.js";function L(r){return Object.entries(r??{}).map(([e,n])=>({label:e,value:n}))}const C=_({__name:"TagList",props:{tags:{},shouldTruncate:{type:Boolean,default:!1},alignment:{default:"left"}},setup(r){const e=r,n=d(()=>(Array.isArray(e.tags)?e.tags:L(e.tags)).map(l=>{const{label:s,value:t}=l,i=f(l),h=s.includes(".kuma.io/")||s.startsWith("kuma.io/");return{label:s,value:t,route:i,isKuma:h}})),u=d(()=>e.shouldTruncate||Object.keys(n.value).length>10);function f(a){if(a.value!=="*")switch(a.label){case"kuma.io/zone":return{name:"data-plane-list-view",query:{query:`tag: "kuma.io/zone:${a.value}"`}};case"kuma.io/service":return{name:"data-plane-list-view",query:{query:`tag: "kuma.io/service:${a.value}"`}};case"kuma.io/mesh":return{name:"mesh-detail-view",params:{mesh:a.value}};default:return}}return(a,l)=>{const s=g("KBadge");return o(),c(p(u.value?"KTruncate":"div"),{width:u.value?"auto":void 0,class:B({"tag-list":!u.value,"tag-list--align-right":e.alignment==="right"})},{default:m(()=>[(o(!0),T(k,null,w(n.value,(t,i)=>(o(),c(s,{key:i,"max-width":"auto",class:"tag",appearance:t.isKuma?"info":"neutral"},{default:m(()=>[(o(),c(p(t.route?"RouterLink":"span"),{to:t.route},{default:m(()=>[b(v(t.label)+":",1),y("b",null,v(t.value),1)]),_:2},1032,["to"]))]),_:2},1032,["appearance"]))),128))]),_:1},8,["width","class"])}}}),q=x(C,[["__scopeId","data-v-07be7319"]]);export{q as T};
